class Solution
{
public:
    vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices)
    {
        // 系数矩阵非奇异一定有解，直接求出解，判断是否为非负整数即可
        double bigBurgerCount = 0.5 * (1 * tomatoSlices - 2 * cheeseSlices);
        double smallBurgerCount = 0.5 * (-1 * tomatoSlices + 4 * cheeseSlices);
        if (bigBurgerCount >= 0.0 && smallBurgerCount >= 0.0 && floor(bigBurgerCount) == bigBurgerCount && floor(smallBurgerCount) == smallBurgerCount)
        {
            return {static_cast<int>(bigBurgerCount), static_cast<int>(smallBurgerCount)};
        }
        else
        {
            return {};
        }
    }
};